
package org.openeai.lite.esb.components;

import org.apache.log4j.Logger;
import org.openeai.lite.common.util.Constants;


/**
 * TODO type description.
 * 
 */
public class TopicLogComponent
{
    private Logger log = Logger.getLogger(TopicLogComponent.class);

    /**
     * Write the payload content to logger.
     * 
     * @param payload : message payload
     * @return Object : same payload, passed on the next component
     */
    public Object log(Object payload)
    {
        if (payload instanceof String)
        {
            log.info("[" + Constants.MQ_UNITY_DEFAULT_TOPIC + "] " + payload);
        }
        else
        {
            log.info("[" + Constants.MQ_UNITY_DEFAULT_TOPIC + "] Message reveived.");
        }
        return payload;
    }

}
